package com.wechat.pay.contrib.apache.httpclient;

import java.io.IOException;

import org.apache.http.client.methods.HttpRequestWrapper;

/**
 * 凭证处理器, 获取签名等信息;
 * 参考https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_0.shtml;
 */
public interface Credentials {

    /**
     * 获取认证类型
     *
     * @return 认证类型
     */
    String getSchema();

    /**
     * 获取签名信息, 参考https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_0.shtml;
     *
     * @param request request对象, 用于获取Method, URL, body(如果有)
     * @return 签名信息
     * @throws IOException 异常
     */
    String getToken(HttpRequestWrapper request) throws IOException;

}
